<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<title>Messenger Device Controller</title>
<style type="text/css">
li {
    margin-bottom: 10px;
}
#openSecondaryWindowLabel {
    text-decoration: underline;
    cursor: pointer;
}
</style>
<script type="text/javascript">

// Hi there. Welcome to the Yahoo! Instant Messenger Plugin Demo.
// A decent knowledge of Javascript and general web development is a prerequisite for
// understanding this demo. I can tell you're excited already, so let's jump right in.

// an onLoad function is something I recommended for all plugins
    // the window.external object gives you access to the Yahoo! Messenger Plugin SDK
    // I like to name it something short, like y, for easy access

function onLoad() {


    var y = window.external;
    var mainWindow = y.Messenger.MainWindow;

    y.SetEventHandler('PluginMessage', on_PluginMessage);

    // function to handle the Plugin message event
    function on_PluginMessage(mes, friend) {
        y.ToastShow("on_PluginMessage", 25, "Makehttp request here");
    }

    y.SetEventHandler('PluginStatus', on_PluginStatus);

    // function to handle the Plugin message event
    function on_PluginStatus(friend, text, data) {
        y.ToastShow("on_PluginMessage", 25, "Makehttp request here");
    }

    mainWindow.SetEventHandler("FriendSelected", onFriendSelected);

    // function to handle the Plugin message event
    function onFriendSelected(friend) {
        y.ToastShow("onFriendSelected", 5, "Friend Selected");
//        y.OpenURL('http://127.0.0.1:3490', false);
    }

    var mess = y.Messenger;
    mess.SetEventHandler("WindowCreated", onWindowCreated);

    function onWindowCreated (type, win) {
        y.ToastShow("Window Created", 10, type);
    }

    // this tells Yahoo! Messenger that the plugin is ready to begin handling the events for which I've defined handlers for
    y.LocalReady();
}

</script>
</head>
<body onload="onLoad();">

<div id="container">
<ul>

<li>
Welcome to the Yahoo! Instant Messenger Device Server Demo.
</li>

</ul></div>

</body>
</html>